package org.opu.doc2db.document.txtdoc.io;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Row contain list of cells
 * @author yura
 */
public class Row implements Iterable<Cell> {

    List<Cell> cells = new ArrayList<Cell>();

    @Override
    public Iterator<Cell> iterator() {
        return cells.iterator();
    }

    void add(Cell cell) {
        cells.add(cell);
    }

    int width() {
        int tmax = 0;
        for (Cell c : this) {
            tmax += c.split;
        }
        return tmax;
    }

    int size() {
        return cells.size();
    }
}
